function addformhashtag()
{
$("#addform").append('<div id="feature'+rowdiv+'" class="itPlg addHshPlug featureclass">'+dataform['hashtag']+"</div>");
var rownow=rowdiv;

   $('#feature'+rownow+' .deleterowbutton').click(function(){
   
    $('#feature'+rownow).remove();
    
   });
   rowdiv++;

}
function saveformhashtag(id,plugid)
{
        var obj={};
        var detail=$("#"+id+'  input[name="detail[]"]').val();
        var amount=$("#"+id+' select[name="amount[]"]').val();

        obj={plugid:plugid,amount:amount,detail:detail};
       
        return obj;
}
function getformhashtag(dataplugin)
{
//console.log(dataplugin);
var code="";
if(dataplugin['product'].length)
{
code = '<div style="left:0.5px" class="ldIt wrpHshLd clearfix" id="pageRowSet-'+dataplugin['phashid']+'">\n';
var narr=dataplugin['detail'].split("#");
var strsearch="";
$.each(narr, function(key, value) {
 if(value)
     {
     strsearch+='<a href="'+baseinfo+'/tag/'+value+'" target="_blank">#'+value+'</a> ';
     
     }

});

code+='<div class="wrpHshTag">HashTag | '+strsearch+'</div>';

$.each(dataplugin['product'], function(key, value) {

code += '<div onclick="linkto(\''+baseinfo+'/'+value['link']+'/'+value['productid']+'\')" class="wrpInCellHvr  wrpHshCell w238" id="wrpInCell-'+value['productid']+'" style="width:193px;height:193px;margin:10px">\n';
code += '<div class="ovlCell w238"></div>\n';
code += '<img width="238" height="238" alt="img" src="'+value['simg']['newpath']+'" class="imgCell w238">\n';
code += '<div class="ldTtlCell fs09 clTxtCell cutTxt">'+value['title']+'</div>\n';
code += '<div class="authCell clearfix fs03 clTxtCell">\n';
code += '<img width="36" height="36" alt="User Image" class="imgUserCell" src="'+value['userssimg']['newpath']+'">\n';
code += '<span class="authName cutTxt">'+value['displayname']+'</span>\n';
//code += '<span class="proUser proCell clBgSp2 clTxtW fs01">Pro</span>\n';
code += '</div>\n';
code += '<div class="wrpLikeCell" onclick="favfunction('+value['productid']+')">\n';
code += '<i class="ico icoUnLikeW"></i>\n';
code += '<span class="numLikeCell fs03 clTxtCell">'+value['countlike']+'</span>\n';
code += '</div>\n';
code += '</div>\n';
});


code += '</div>';
code +='<script>'
code +='setpagination(".pageSetHshTag-'+dataplugin['phashid']+'",'+dataplugin['total_page']+',1,"loadpagehashtag","'+dataplugin['detail']+'","'+dataplugin['amount']+'",'+dataplugin['phashid']+');'
code +='</script>'
code+='<div class="wrpPageHshTag">';
code+='<span class="pageHshTag pageSetHshTag-'+dataplugin['phashid']+'"></span>';
code+='</div>';


}
//var code = '<div class="ldIt wrpImgLd clBg4 w640" onclick="openmaingallery('+dataplugin.simgmid+')">\n';
//code += '<div class="icoDefLd">\n';
//code += '<span class="ico icoImgDefLd"></span>\n';
//code += '<span>Image</span>\n';
//code += '</div>\n';
//code += '<div class="wrpImgDesLd">\n';
//code += '<a href="javascript:void(0)"   class="galleryimage" ><img  title="'+dataplugin.img.newpath+'" width="640" height="360" alt="'+dataplugin.img.width+'|'+dataplugin.img.height+'" id="img-'+dataplugin.simgmid+'" src="'+dataplugin.simg.newpath+'"></a>\n';
//code += '<div class="desImgLd clTxtW" >\n';
//code += '<div class="ovlLd ovlImgLd w640" >\n';
//code += '<p class="cutTxt">'+dataplugin.detail+'</p>\n';
//code += '</div>\n';
//code += '</div>\n';
//code += '</div>\n';
//code += '</div>';
return code;


}
function editformhashtag(datarow)
{
       addformhashtag();

       var rownow= rowdiv-1;
       var rowgnow2=1;
       
       

    $('#feature'+rownow+' select[name="amount[]"]').val(datarow.amount);

    $('#feature'+rownow+' input[name="detail[]"]').val(datarow.detail);   


}
function loadpagehashtag(page,tagname,amount,idtarget)
{
var xmlRequest=   $.get(serviceinfo+'getproductbytagname', { page:page,tagname:tagname,amount:amount }, function(dataplugin) {  

if(dataplugin['data'].length)
{
var code="";
var narr=tagname.split("#");
var strsearch="";
$.each(narr, function(key, value) {
 if(value)
     {
     strsearch+='<a href="'+baseinfo+'/tag/'+value+'" target="_blank">#'+value+'</a> ';
     
     }

});
code+='<div class="wrpHshTag">HashTag | '+strsearch+'</div>';

$.each(dataplugin['data'], function(key, value) {

code += '<div onclick="linkto(\''+baseinfo+'/'+value['link']+'/'+value['productid']+'\')" class="wrpInCellHvr  wrpHshCell w238" id="wrpInCell-'+value['productid']+'" style="width:193px;height:193px;margin:10px">\n';
code += '<div class="ovlCell w238"></div>\n';
code += '<img width="238" height="238" alt="img" src="'+value['simg']['newpath']+'" class="imgCell w238">\n';
code += '<div class="ldTtlCell fs09 clTxtCell cutTxt">'+value['title']+'</div>\n';
code += '<div class="authCell clearfix fs03 clTxtCell">\n';
code += '<img width="36" height="36" alt="User Image" class="imgUserCell" src="'+value['userssimg']['newpath']+'">\n';
code += '<span class="authName cutTxt">'+value['displayname']+'</span>\n';
//code += '<span class="proUser proCell clBgSp2 clTxtW fs01">Pro</span>\n';
code += '</div>\n';
code += '<div class="wrpLikeCell" onclick="likefunction('+value['productid']+')">\n';
code += '<i class="ico icoUnLikeW"></i>\n';
code += '<span class="numLikeCell fs03 clTxtCell">'+value['countlike']+'</span>\n';
code += '</div>\n';
code += '</div>\n';
});




$("#pageRowSet-"+idtarget).html(code);



}


});

}